package com.example.demo.mapper;

import com.example.demo.DTO.HR_Login_DTO;
import com.example.demo.entity.HR;
import com.example.demo.entity.JobPosition;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

@Mapper
public interface HR_Mapper {

@Select("SELECT * FROM hr WHERE username = #{username} AND password = #{password}" )
HR login(HR_Login_DTO hrLoginDto);

    @Insert("INSERT INTO hr (username, password, name, email, company_id, job_id) VALUES (#{username}, #{password}, #{name}, #{email}, #{companyId}, #{jobId})")
    int Register(HR hr);

    int updata(HR hr);

    @Select("SELECT * FROM jobposition WHERE hrId = #{id}")
    ArrayList<JobPosition> select(Integer id);
}
